fix(bridge-ui): fix issue where balance is shown for wrong token #16541
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
When I was testing the testnet with the HORSE ERC20 token, trying to bridge it, at the "Review" stage of the bridging process I pressed edit and it went back to the first "Import" stage. At that point I saw "Balance: 50 HORSE" and thought the HORSE token was still selected, so I entered 1 for the amount and bridged but, unbeknown to me, ETH was actually selected instead and it transferred ETH instead of HORSE. Since I can see this being a problem for users in the future I've fixed the issue by making sure the Balance shown is of the selected ETH.
STEPS TO REPRODUCE
1 ) Select the HORSE token for bridging
2 ) Go back to the first "Import" stage by either presing 'Edit' or 'Go Back'
3 ) Observe that ETH is selected as the default coin but the HORSE balance is shown